package org.opens.controller;


import org.opens.common.api.Result;
import org.opens.dto.ChannelPageDto;
import org.opens.entity.ChannelEntity;
import org.opens.service.ChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@RequestMapping(value = "/netty/channel")
@ResponseBody
public class DbController {

    @Autowired
    private ChannelService channelService;

    @GetMapping(value = "/queryPageList")
    public Result<List<ChannelEntity>> queryPageList(
            ChannelPageDto channelPageDto,
            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize
    ) {
        return Result.success(channelService.list());
    }

}
